<!doctype html>
<html>
	<head>
		<meta content="text/html; charset=UTF-8" http-equiv="content-type" />
<meta name="viewport" content="width=device-width,initial-scale=1">
		<!--<script type="text/javascript" src="../src/jmchart.debug.js" id="jmgraph" ></script>-->

		<style>
		html,body {
			margin:0;
			padding:10px;
			width:100%;
			height:100%;
		}
		#mycanvas canvas, #mycanvas div{
			background-color:#fff;
			margin:0 auto;		
		}
		/*div.jm-tooltip {
			background-color: rgba(255,255,255,0.8);
			padding:4px;
			border:1px solid #000;
			box-shadow: 0 0 3px #000;
			border-radius: 6px;
		}*/
		</style>
		<script type="module">
			//window.devicePixelRatio = 1;
			import { jmChart } from '../dist/jmchart.esm.js';

			(function load() {
				var w = Math.max((window.innerWidth || window.document.body.clientWidth) * 0.9, 600);
				var h = Math.max((window.innerHeight || window.document.body.clientHeight) * 0.6, 200);			
				inichart(w,h);
			})();
			

			function inichart(w, h) {
					var chart = new jmChart('mycanvas', {
						width: w,
						height: h,
						xField: 'date',
						//baseY: 0,
						enableAnimate: true,
						autoRefresh: true,
						
						style: {
							margin: {
								left: 50
							},
							legend: {
								legendPosition: 'top'
							}
						}
					});
					//chart.legend.legendPosition = 'top';
					chart.legend.visible = true;

					// touch改变数据点事件
					chart.on('touchPointChange', function(args) {
						console.log(args);
					});

					var line1 = chart.createSeries('line', {
						field: 'nav',
						//index: 2, // 指定Y轴索引，如是档指定就会共用左边的Y轴，
						// 最大值和最小值，如果不指定会自动计算，
						// 如果指定了也只是指定了最大或最小边界，如果有数值超过它，依然以事实数值为准
						minYValue: 0.97,
						maxYValue: 1.05,
						style: {
							// 画圆滑的曲线 
							curve: true,// 填充图形
							label: {
								show: true
							},
						},						
					});		
					
		
					chart.data = [ { "since_setup_rise_rate": "0", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1, "nav": 1, "year1_rise_rate": "-", "date": "2022-06-27", "day7_rise_rate_year": "-", "accumulative_nav": 1, "per_ten_thousands_income": 0, "day1_rise_rate": "-" }, { "since_setup_rise_rate": "0.0025", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1.0025, "nav": 1.0025, "year1_rise_rate": "-", "date": "2022-07-01", "day7_rise_rate_year": "0", "accumulative_nav": 1.0025, "per_ten_thousands_income": 0, "day1_rise_rate": "0.0025" }, { "since_setup_rise_rate": "0.0023", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1.0023, "nav": 1.0023, "year1_rise_rate": "-", "date": "2022-07-08", "day7_rise_rate_year": "0", "accumulative_nav": 1.0023, "per_ten_thousands_income": 0, "day1_rise_rate": "-0.0002" }, { "since_setup_rise_rate": "0.0028", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1.0028, "nav": 1.0028, "year1_rise_rate": "-", "date": "2022-07-15", "day7_rise_rate_year": "0", "accumulative_nav": 1.0028, "per_ten_thousands_income": 0, "day1_rise_rate": "0.000499" }, { "since_setup_rise_rate": "0.0057", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "-", "adjusted_nav": 1.0057, "nav": 1.0057, "year1_rise_rate": "-", "date": "2022-07-22", "day7_rise_rate_year": "0", "accumulative_nav": 1.0057, "per_ten_thousands_income": 0, "day1_rise_rate": "0.002892" }, { "since_setup_rise_rate": "0.0079", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.0079", "adjusted_nav": 1.0079, "nav": 1.0079, "year1_rise_rate": "-", "date": "2022-07-29", "day7_rise_rate_year": "0", "accumulative_nav": 1.0079, "per_ten_thousands_income": 0, "day1_rise_rate": "0.002188" }, { "since_setup_rise_rate": "0.0094", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.006883", "adjusted_nav": 1.0094, "nav": 1.0094, "year1_rise_rate": "-", "date": "2022-08-05", "day7_rise_rate_year": "0", "accumulative_nav": 1.0094, "per_ten_thousands_income": 0, "day1_rise_rate": "0.001488" }, { "since_setup_rise_rate": "0.0103", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.007982", "adjusted_nav": 1.0103, "nav": 1.0103, "year1_rise_rate": "-", "date": "2022-08-12", "day7_rise_rate_year": "0", "accumulative_nav": 1.0103, "per_ten_thousands_income": 0, "day1_rise_rate": "0.000892" }, { "since_setup_rise_rate": "0.0164", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.013562", "adjusted_nav": 1.0164, "nav": 1.0164, "year1_rise_rate": "-", "date": "2022-08-19", "day7_rise_rate_year": "0", "accumulative_nav": 1.0164, "per_ten_thousands_income": 0, "day1_rise_rate": "0.006038" }, { "since_setup_rise_rate": "0.0155", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.009744", "adjusted_nav": 1.0155, "nav": 1.0155, "year1_rise_rate": "-", "date": "2022-08-26", "day7_rise_rate_year": "0", "accumulative_nav": 1.0155, "per_ten_thousands_income": 0, "day1_rise_rate": "-0.000885" }, { "since_setup_rise_rate": "0.0168", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.00883", "adjusted_nav": 1.0168, "nav": 1.0168, "year1_rise_rate": "-", "date": "2022-09-02", "day7_rise_rate_year": "-", "accumulative_nav": 1.0168, "per_ten_thousands_income": 0, "day1_rise_rate": "0.00128" }, { "since_setup_rise_rate": "0.0193", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.009808", "adjusted_nav": 1.0193, "nav": 1.0193, "year1_rise_rate": "-", "date": "2022-09-09", "day7_rise_rate_year": "-", "accumulative_nav": 1.0193, "per_ten_thousands_income": 0, "day1_rise_rate": "0.002459" }, { "since_setup_rise_rate": "0.0256", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.015144", "adjusted_nav": 1.0256, "nav": 1.0256, "year1_rise_rate": "-", "date": "2022-09-16", "day7_rise_rate_year": "-", "accumulative_nav": 1.0256, "per_ten_thousands_income": 0, "day1_rise_rate": "0.006181" }, { "since_setup_rise_rate": "0.0287", "month6_rise_rate": "-", "month3_rise_rate": "-", "month1_rise_rate": "0.012102", "adjusted_nav": 1.0287, "nav": 1.0287, "year1_rise_rate": "-", "date": "2022-09-23", "day7_rise_rate_year": "-", "accumulative_nav": 1.0287, "per_ten_thousands_income": 0, "day1_rise_rate": "0.003023" }, { "since_setup_rise_rate": "0.0287", "month6_rise_rate": "-", "month3_rise_rate": "0.0287", "month1_rise_rate": "0.012999", "adjusted_nav": 1.0287, "nav": 1.0287, "year1_rise_rate": "-", "date": "2022-09-30", "day7_rise_rate_year": "-", "accumulative_nav": 1.0287, "per_ten_thousands_income": 0, "day1_rise_rate": "0" }, { "since_setup_rise_rate": "0.0299", "month6_rise_rate": "-", "month3_rise_rate": "0.027537", "month1_rise_rate": "0.010399", "adjusted_nav": 1.0299, "nav": 1.0299, "year1_rise_rate": "-", "date": "2022-10-14", "day7_rise_rate_year": "-", "accumulative_nav": 1.0299, "per_ten_thousands_income": 0, "day1_rise_rate": "0.001167" }, { "since_setup_rise_rate": "0.0316", "month6_rise_rate": "-", "month3_rise_rate": "0.02872", "month1_rise_rate": "0.00585", "adjusted_nav": 1.0316, "nav": 1.0316, "year1_rise_rate": "-", "date": "2022-10-21", "day7_rise_rate_year": "-", "accumulative_nav": 1.0316, "per_ten_thousands_income": 0, "day1_rise_rate": "0.001651" }, { "since_setup_rise_rate": "0.0282", "month6_rise_rate": "-", "month3_rise_rate": "0.022372", "month1_rise_rate": "-0.000486", "adjusted_nav": 1.0282, "nav": 1.0282, "year1_rise_rate": "-", "date": "2022-10-28", "day7_rise_rate_year": "-", "accumulative_nav": 1.0282, "per_ten_thousands_income": 0, "day1_rise_rate": "-0.003296" } ];
					
						chart.refresh();
            
					
				}
			
		</script>
	</head>
	<body>
		<div id="mycanvas">
			</div>	
	</body>
</html>